home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Resources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  5.1 KB  |  179 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Resources.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __RESOURCES__
  13. #define __RESOURCES__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. #ifndef __FILES__
  20. #include <Files.h>
  21. #endif
  22.  
  23.  
  24. enum {
  25.  
  26.  resSysHeap = 64,        /*System or application heap?*/
  27.  resPurgeable = 32,        /*Purgeable resource?*/
  28.  resLocked = 16,        /*Load it in locked?*/
  29.  resProtected = 8,        /*Protected?*/
  30.  resPreload = 4,        /*Load in on OpenResFile?*/
  31.  resChanged = 2,        /*Resource changed?*/
  32.  mapReadOnly = 128,        /*Resource file read-only*/
  33.  mapCompact = 64,        /*Compact resource file*/
  34.  mapChanged = 32,        /*Write map out at updat*/
  35.  
  36. /* Values for setting RomMapInsert and TmpResLoad */
  37.  mapTrue = 0xFFFF,        /*insert ROM map w/ TmpResLoad = TRUE.*/
  38.  mapFalse = 0xFF00        /*insert ROM map w/ TmpResLoad = FALSE.*/
  39. };
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. pascal short InitResources(void)
  45.  = 0xA995; 
  46. pascal void RsrcZoneInit(void)
  47.  = 0xA996; 
  48. pascal void CloseResFile(short refNum)
  49.  = 0xA99A; 
  50. pascal short ResError(void)
  51.  = 0xA9AF; 
  52. pascal short CurResFile(void)
  53.  = 0xA994; 
  54. pascal short HomeResFile(Handle theResource)
  55.  = 0xA9A4; 
  56. pascal void CreateResFile(ConstStr255Param fileName)
  57.  = 0xA9B1; 
  58. pascal short OpenResFile(ConstStr255Param fileName)
  59.  = 0xA997; 
  60. pascal void UseResFile(short refNum)
  61.  = 0xA998; 
  62. pascal short CountTypes(void)
  63.  = 0xA99E; 
  64. pascal short Count1Types(void)
  65.  = 0xA81C; 
  66. pascal void GetIndType(ResType *theType,short index)
  67.  = 0xA99F; 
  68. pascal void Get1IndType(ResType *theType,short index)
  69.  = 0xA80F; 
  70. pascal void SetResLoad(Boolean load)
  71.  = 0xA99B; 
  72. pascal short CountResources(ResType theType)
  73.  = 0xA99C; 
  74. pascal short Count1Resources(ResType theType)
  75.  = 0xA80D; 
  76. pascal Handle GetIndResource(ResType theType,short index)
  77.  = 0xA99D; 
  78. pascal Handle Get1IndResource(ResType theType,short index)
  79.  = 0xA80E; 
  80. pascal Handle GetResource(ResType theType,short theID)
  81.  = 0xA9A0; 
  82. pascal Handle Get1Resource(ResType theType,short theID)
  83.  = 0xA81F; 
  84. pascal Handle GetNamedResource(ResType theType,ConstStr255Param name)
  85.  = 0xA9A1; 
  86. pascal Handle Get1NamedResource(ResType theType,ConstStr255Param name)
  87.  = 0xA820; 
  88. pascal void LoadResource(Handle theResource)
  89.  = 0xA9A2; 
  90. pascal void ReleaseResource(Handle theResource)
  91.  = 0xA9A3; 
  92. pascal void DetachResource(Handle theResource)
  93.  = 0xA992; 
  94. pascal short UniqueID(ResType theType)
  95.  = 0xA9C1; 
  96. pascal short Unique1ID(ResType theType)
  97.  = 0xA810; 
  98. pascal short GetResAttrs(Handle theResource)
  99.  = 0xA9A6; 
  100. pascal void GetResInfo(Handle theResource,short *theID,ResType *theType,
  101.  Str255 name)
  102.  = 0xA9A8; 
  103. pascal void SetResInfo(Handle theResource,short theID,ConstStr255Param name)
  104.  = 0xA9A9; 
  105. pascal void AddResource(Handle theResource,ResType theType,short theID,
  106.  ConstStr255Param name)
  107.  = 0xA9AB; 
  108. pascal long SizeResource(Handle theResource)
  109.  = 0xA9A5; 
  110. pascal long MaxSizeRsrc(Handle theResource)
  111.  = 0xA821; 
  112. pascal long RsrcMapEntry(Handle theResource)
  113.  = 0xA9C5; 
  114. pascal void SetResAttrs(Handle theResource,short attrs)
  115.  = 0xA9A7; 
  116. pascal void ChangedResource(Handle theResource)
  117.  = 0xA9AA; 
  118. pascal void RmveResource(Handle theResource)
  119.  = 0xA9AD; 
  120. pascal void UpdateResFile(short refNum)
  121.  = 0xA999; 
  122. Handle getnamedresource(ResType theType,char *name); 
  123. pascal void WriteResource(Handle theResource)
  124.  = 0xA9B0; 
  125. pascal void SetResPurge(Boolean install)
  126.  = 0xA993; 
  127. Handle get1namedresource(ResType theType,char *name); 
  128. pascal short GetResFileAttrs(short refNum)
  129.  = 0xA9F6; 
  130. pascal void SetResFileAttrs(short refNum,short attrs)
  131.  = 0xA9F7; 
  132. pascal short OpenRFPerm(ConstStr255Param fileName,short vRefNum,char permission)
  133.  = 0xA9C4; 
  134. pascal Handle RGetResource(ResType theType,short theID)
  135.  = 0xA80C; 
  136. #if SystemSevenOrLater
  137. pascal short HOpenResFile(short vRefNum,long dirID,ConstStr255Param fileName,
  138.  char permission)
  139.  = 0xA81A; 
  140. #else
  141. pascal short HOpenResFile(short vRefNum,long dirID,ConstStr255Param fileName,
  142.  char permission);
  143. #endif
  144. #if SystemSevenOrLater
  145. pascal void HCreateResFile(short vRefNum,long dirID,ConstStr255Param fileName)
  146.  = 0xA81B; 
  147. #else
  148. pascal void HCreateResFile(short vRefNum,long dirID,ConstStr255Param fileName);
  149. #endif
  150.  
  151. pascal short FSpOpenResFile(const FSSpec *spec,SignedByte permission)
  152.  = {0x303C,0x000D,0xAA52}; 
  153. pascal void FSpCreateResFile(const FSSpec *spec,OSType creator,OSType fileType,
  154.  ScriptCode scriptTag)
  155.  = {0x303C,0x000E,0xAA52}; 
  156. /*  partial resource calls  */
  157. pascal void ReadPartialResource(Handle theResource,long offset,void *buffer,
  158.  long count)
  159.  = {0x7001,0xA822}; 
  160. pascal void WritePartialResource(Handle theResource,long offset,const void *buffer,
  161.  long count)
  162.  = {0x7002,0xA822}; 
  163. pascal void SetResourceSize(Handle theResource,long newSize)
  164.  = {0x7003,0xA822}; 
  165. pascal Handle GetNextFOND(Handle fondHandle)
  166.  = {0x700A,0xA822};
  167.  
  168. short openrfperm(char *fileName,short vRefNum,char permission); 
  169. short openresfile(char *fileName); 
  170. void createresfile(char *fileName); 
  171. void getresinfo(Handle theResource,short *theID,ResType *theType,char *name); 
  172. void setresinfo(Handle theResource,short theID,char *name); 
  173. void addresource(Handle theResource,ResType theType,short theID,char *name); 
  174. #ifdef __cplusplus
  175. }
  176. #endif
  177.  
  178. #endif
  179.